﻿#include <iostream>

using namespace std;

static int Reverse(int x);

int main()
{
	for (int i = 0; i <= 256; i++)
	{
		int a = i * i;
		if (a == Reverse(a))
		{
			cout << i << "\n";
		}
	}
}

static int Reverse(int num)
{
	int revx = 0;
	while (num != 0)
	{
		revx *= 10;
		revx += num % 10;
		num /= 10;
	}
	return  revx;
}

